/*
 * Copyright 2007. Mount Sinai Hospital, Toronto, Canada.
 * 
 * Licensed under the GNU Lesser General Public License, Version 2. You
 * can find a copy of the license at:
 * 
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
 * 
 * IN NO EVENT SHALL MOUNT SINAI HOSPITAL BE LIABLE TO ANY PARTY FOR DIRECT, 
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST 
 * PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 
 * EVEN IF MOUNT SINAI HOSPITAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 
 * DAMAGE.
 * 
 * MOUNT SINAI HOSPITAL SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND 
 * ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". 
 * MOUNT SINAI HOSPITAL HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, 
 * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
 */
package com.sinai.mshab.client.services;

import java.util.ArrayList;
import java.util.HashMap;

import com.google.gwt.user.client.rpc.RemoteService;
import com.sinai.mshab.client.exception.SerializableFileNotFoundException;
import com.sinai.mshab.client.exception.SerializableSQLException;
import com.sinai.mshab.client.ui.Key;
import com.sinai.mshab.client.user.User;
import com.sinai.mshab.client.util.AnswerCollection;

/**
 * This interface defines the MSHAB operations between client and server.
 * 
 * @author serge
 * 
 */
public interface Service extends RemoteService {
	public void sendAnswer(AnswerCollection a, Key key)
			throws SerializableSQLException;

	public HashMap retrieveData(Key key);

	public User validateLogin(String user, String pass);

	public void resetPassword(String username);

	public ArrayList getTables();

	public HashMap getColumnNames();

	public ArrayList execteSQL(String sql, int start, int end);

	public boolean validKey(Key k);

	public ArrayList getSuggestions(String fieldName, String tableName,
			String typed_so_far);

	public String getUserPermission(String username);

	public boolean authenticate(String username, String password);

	public boolean storeFile(String fieldName, String tableName, Key dbKey,
			String filePath) throws SerializableFileNotFoundException,
			SerializableSQLException;
}
